package com.mengxun.myweb.controller;

import com.ruoyi.common.config.Global;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.system.domain.SysMenu;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController extends BaseController {
    @Autowired
    private ISysMenuService menuService;

    // 系统首页
    @RequestMapping("/index")
    public String index(ModelMap mmap) {
        // 取身份信息
        //SysUser user = ShiroUtils.getSysUser();
        // 根据用户id取出菜单
       List<SysMenu> menus = menuService.selectMenusByUser(new SysUser());
        mmap.put("menus", menus);
     //   mmap.put("user", user);
        mmap.put("copyrightYear", Global.getCopyrightYear());
        return "index";
    }
}